home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / prog / graphic.zip / RECTANGL.C < prev    next >
Text File  |  1991-12-24  |  1KB  |  26 lines

  1. /**********************************************************************
  2. RECTANGL.C
  3. Description -  draws a rectangle
  4. **********************************************************************
  5. Function - rectangle(x,y,horiz width,vertical height)
  6. Input - xy coord of upper left corner, width, height
  7. Output - to the screen
  8. #includes - none
  9. #defines  - none
  10. Routines Called - line, plotxy
  11. Notes - offsets vertical scale
  12. **********************************************************************/
  13. rectangle(x,y,sidex,sidey)
  14. int x,y,sidex,sidey;
  15. {
  16.   int x1,y1;
  17.   x1=x+sidex; /* horizontal width */
  18.   y1=y+((sidey*2)/5); /* vertical height */
  19.   line(x,y,x1,y); /* top horiz line */
  20.   line(x,y1,x1,y1); /* bott horiz line */
  21.   line(x,y,x,y1); /* left vertical line */
  22.   line(x1,y,x1,y1); /* right vertical line */
  23.   return;
  24. }
  25. /******************** end of function ********************************/
  26.